#define _CRT_SECURE_NO_WARNINGS

#include "list.h"
using namespace little_monster;

void test1()
{
	list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_back(4);
	lt1.push_back(5);

	list<int> lt2(lt1);

	for (auto e : lt1)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;

	for (auto e : lt2)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;
}

void test2()
{
	list<int> lt1;
	lt1.push_back(1);
	lt1.push_back(2);
	lt1.push_back(3);
	lt1.push_back(4);
	lt1.push_back(5);

	lt1.insert(++lt1.begin(), 6);
	lt1.insert(--lt1.end(), 7);

	for (auto e : lt1)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;

	lt1.erase(++lt1.begin());
	lt1.erase(--lt1.end());

	for (auto e : lt1)
	{
		std::cout << e << " ";
	}
	std::cout << std::endl;
}

struct AA
{
	AA(int a1 = 0, int a2 = 0)
		:_a1(a1)
		, _a2(a2)
	{}

	int _a1;
	int _a2;
};

void test3()
{
	list<AA> lt;
	lt.push_back(AA(1, 1));
	lt.push_back(AA(2, 2));
	lt.push_back(AA(3, 3));

	auto it = lt.begin();
	while (it != lt.end())
	{
		std::cout << (*it)._a1<<" "<<(*it)._a2 << std::endl;
		std::cout << it->_a1 << " " << it->_a2 << std::endl;
		std::cout << it.operator->()->_a1 << " " << it.operator->()->_a1 << std::endl;

		++it;
	}
	std::cout << std::endl;

}

void test4()
{
	/*int* p = new int;
	*p = 1;*/
	int* p = new int(1);

	AA* ptr = new AA;
	ptr->_a1 = 1;
}

int main()
{
	test4();
	return 0;
}